package Entity;
import Controller.Client;

/**
 * this is a entity for the customer. the customer will insert his id, full name, mail and password. the system will set the account balance.
 * @author Sandra Krasko
 *
 */
public class Customer {
	private String customer_id;
	private String first_name;
	private String last_name;
	private String mail;
	private String password;
	private double acc_balance;
	/**
	 * is the default constructor. will only set the balnce account to zero. 
	 */
	public Customer()
	{
		acc_balance=0;
	}
	/**
	 * is the other constructor. it will set the new customer by the following parameters:
	 * @param customer_id
	 * @param first_name
	 * @param last_name
	 * @param mail
	 * @param password
	 */
	public Customer(String customer_id,String first_name,String last_name,String mail,String password)
	{
		this.customer_id=customer_id;
		this.first_name=first_name;
		this.last_name=last_name;
		this.mail=mail;
		this.password=password;
		acc_balance=0;
	}
	
	/**
	 * will add the sum to the account balance of the customer.
	 * @param sum= the sum to add.
	 */
	public void AddBalance(double sum)
	{
		this.acc_balance+=sum;
		Client.updateCustomer(this);
	}
	

	public String getcustomer_id()
	{return this.customer_id;}
	public void setcustomer_id(String customer_id)
	{this.customer_id=customer_id;}
	
	
	public String getFirst_name()
	{return this.first_name;}
	public void setFirst_name(String first_name)
	{this.first_name=first_name;}
	
	public String getLast_name()
	{return this.last_name;}
	public void setLast_name(String last_name)
	{this.last_name=last_name;}
	
	public String getMail()
	{return this.mail;}
	public void setMail(String mail)
	{this.mail=mail;}
	
	public String getPassword()
	{return this.password;}
	public void setPassword(String password)
	{this.password=password;}
	
	public double getAcc_balance()
	{return this.acc_balance;}
	public void setAcc_balance(double acc_balance)
	{this.acc_balance=acc_balance;}
	
}
